let Vue = require('vue');
let render = require('vue-server-renderer');
let express = require('express');
let app = express();
let vm = new Vue({ 
    data:{
        msg:'hello  world',
    },
    template:('<h1>{{msg}}</h1>')
})
const renderer = render.createRenderer({
    template: require('fs').readFileSync('./index.html', 'utf-8')
})
app.get('/', (req,res)=>{
    renderer.renderToString(vm,(err,html)=>{
        res.send(html);
    });
});
app.listen(3000);